package org.file5.util;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

public class FileInfo {

	private String path;

	private String lastModified;

	private String ext;

	private long size;
	private final static SimpleDateFormat df = new SimpleDateFormat(
			"yyyy-MM-dd HH:mm");

	public FileInfo(File file) {
		this.path = file.getPath().replace("\\", "/");

		this.lastModified = df.format(new Date(file.lastModified()));
		this.ext = "";
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}


	public String getLastModified() {
		return lastModified;
	}

	public void setLastModified(String lastModified) {
		this.lastModified = lastModified;
	}

	public String getExt() {
		return ext;
	}

	public void setExt(String ext) {
		this.ext = ext;
	}

	public long getSize() {
		return size;
	}

	public void setSize(long size) {
		this.size = size;
	}

	public String toString() {
		return ToStringBuilder.reflectionToString(this,
				ToStringStyle.MULTI_LINE_STYLE);
	}

}
